diff --git a/django/core/cache/backends/base.py b/django/core/cache/backends/base.py
index 22b8397cac..26a28a9ab4 100644
--- a/django/core/cache/backends/base.py
+++ b/django/core/cache/backends/base.py
@@ -166,16 +166,11 @@ class BaseCache:
         Return the value of the key stored or retrieved.
         """
         val = self.get(key, version=version)
-        if val is None:
+        if not self.has_key(key, version=version):
             if callable(default):
                 default = default()
-            if default is not None:
-                self.add(key, default, timeout=timeout, version=version)
-                # Fetch the value again to avoid a race condition if another
-                # caller added a value between the first get() and the add()
-                # above.
-                return self.get(key, default, version=version)
-        return val
+            self.add(key, default, timeout=timeout, version=version)
+        return val if val is not None else default
 
     def has_key(self, key, version=None):
         """
